package com.itheima.JDK8date;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class LocalDateDemo {
    public static void main(String[] args) {
        //当前时间点
        LocalDateTime now = LocalDateTime.now();//通过类名点方法的形式,静态方法
        System.out.println(now);
        //自行设置时间
        LocalDateTime localDateTime = LocalDateTime.of(1995, 10, 28, 12, 12, 12);
        System.out.println(localDateTime);
        //创建一个指定格式,将上面的日期转为字符串格式日期,用format
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        //String s = LocalDateTime.format(pattern);

    }
}
